﻿using K9Nano.IM.Caching;

namespace K9Nano.IM.Security
{
    public class AppMd5SignModelManager : Md5SignModelManager<IAppSignModel>, IAppSignModelManager
    {
        private readonly ChatAppCache _appCache;

        public AppMd5SignModelManager(ChatAppCache appCache)
        {
            _appCache = appCache;
        }

        protected override string GetSecret(IAppSignModel model)
        {
            return _appCache.Get(model.AppId)?.Secret;
        }
    }
}